{
 "metadata": {
  "name": "",
  "signature": "sha256:172b6356328aa39c4adc43216a1a9c26b43c777d81179f851005b15a6a82f5e1"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "<h2>Change in likelihood of training data as model order is increased</h2>\n",
      "<p>We will now see how the likelihood changes as we make the model more complex. To avoid numerical problems, we will first re-scale $x$.</p>"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import urllib\n",
      "urllib.urlretrieve('https://github.com/sdrogers/fcml/raw/master/notebooks/data/olympic100m.txt', 'olympic100m.txt')\n",
      "import numpy as np\n",
      "data = np.loadtxt('olympic100m.txt',delimiter=',')\n",
      "x = data[:,0][:,None]\n",
      "t = data[:,1][:,None]\n",
      "x = (x - x[0])/4.0"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 1
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import numpy as np\n",
      "\n",
      "def loggausspdf(x,mu,sig_sq):\n",
      "    const = -0.5*np.log(2.0*np.pi) - 0.5*np.log(sig_sq)\n",
      "    return const - (1.0/(2*sig_sq))*(x-mu)**2\n",
      "\n",
      "X = np.ones_like(x)\n",
      "maxOrder = 7\n",
      "L = np.zeros((maxOrder+1,1))\n",
      "for i in np.arange(maxOrder+1):\n",
      "    w = np.dot(np.linalg.inv(np.dot(X.T,X)),np.dot(X.T,t))\n",
      "    sig_sq = ((t-np.dot(X,w))**2).mean()\n",
      "    L[i] = loggausspdf(t,np.dot(X,w),sig_sq).sum()\n",
      "    X = np.hstack((X,x**(i+1)))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 2
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "<p>Plot the likelihood</p>"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import pylab as plt\n",
      "%matplotlib inline\n",
      "plt.plot(np.arange(maxOrder+1),L)\n",
      "plt.xlabel('Polynomial order')\n",
      "plt.ylabel('Likelihood on training data')"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 3,
       "text": [
        "<matplotlib.text.Text at 0x107005290>"
       ]
      },
      {
       "metadata": {},
       "output_type": "display_data",
       "png": "iVBORw0KGgoAAAANSUhEUgAAAYUAAAEPCAYAAACtCNj2AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XmUFOW5x/EvAoIoCIoiCDosbiwqKgguoV0vqEncl7jh\ndk2MS6K5Uck5cTTJid7caAyJ5kbCgChEzQUEcQE9tBAFBGUZEGSRVQEB2VWWmb5/PNXTPTM9PTXT\nVV1VPb/POXW6unqpZzzyPv3uICIiIiIiIiIiIiIiIiIiIiIiIiIiEmnDgY1Aadq1YmAdMNc5BuY/\nLBERCcK5QG8qJ4XHgAeDCUdEpGE7IOD7Twe2ZrjeKN+BiIhI8EmhJvcB84F/AK0DjkVERPKoiMrN\nR0diNYVGwG+xxCAiInnQJOgAMvgq7XwYMLHqG7p27ZpYsWJF/iISESkMK4Bu2d4Qxuaj9mnnV1C5\nFgHAihUrSCQSkT0ee+yxwGNQ/MHHofijd0Qh9i1bEsTjCYYOTXD33QnOOitBq1YJOnRIAHStrQAO\nuqYwBhgAtAXWYiOPYsCpQAJYCdwdVHAiImH17beweDGUltqxcKE97toFPXtCr172eMMN9nj44dDI\nxRCeoJPCDRmuDc97FCIiIVVWBitWpAr95LFmDRx3nBX+vXrBffdZ4X/MMe4K/5oEnRQapFgsFnQI\nOVH8wVL8wfEz9kQCNmyo/st/8WJo1y716//qq+Hxx+H446FpU+/jiOp8gEQikQg6BhGRetmxAxYt\nqvzLf+FC+4WfbPZJ1gB69ICWLb25byOrQmQt95UURER8sncvfPZZ5V/+paWwaRN07149AbRrl1vT\nT22UFERE8iCRgNWrqzf9LF8Oxx6bKvSTSaB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kupwFRERERERERERERERERERERERERERERHv/T+uUP6DtntGtwAAAABJRU5ErkJg\ngg==\n",
       "text": [
        "<matplotlib.figure.Figure at 0x106f05f50>"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "<p>It can be seen from the plot that the likelihood increases as the polynomial order increases.</p>"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 3
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [],
     "language": "python",
     "metadata": {},
     "outputs": []
    }
   ],
   "metadata": {}
  }
 ]
}